
#ifndef _RELATION_H_
#define _RELATION_H_

#include <QXmlStreamReader>
#include <QXmlStreamWriter>

#include "TrueLoveClient.h"

class Relation
{

public:
	Relation() {}
	Relation(int pId1, int pId2) { id1 = pId1; id2 = pId2; }
	~Relation() {}
	
	// Misc
	static QList<Relation> GetRelations();
	static Relation ParseRelation(QXmlStreamReader& reader);
	static void SaveRelation(Relation r);
	static void SaveRelations(QList<Relation> r);
	void MangeTousLesBebes() { bebes.clear(); }

	// Getters
	int GetId1() { return id1; }
	int GetId2() { return id2; }
	bool IsMarried() { return married; }
	QList<QString> GetBebes() { return bebes; }
	
	// Setters
	void AddBebe(QString bebe) { bebes.append(bebe); }
	void SetBebes(QList<QString> pBebes) { bebes = pBebes; }
	void SetMarried(bool pMarried) { married = pMarried; }
	void SetId1(int pId1) { id1 = pId1; }
	void SetId2(int pId2) { id2 = pId2; }

private:
	int id1;
	int id2;
	bool married;
	QList<QString> bebes;
	
	static void AddRelationXmlProperties(QXmlStreamWriter* writer, Relation r);
};

#endif

